.ag-tabs-header {
    display: flex;
    background-color: var(--ag-tab-bar-background-color);
    padding: var(--ag-tab-bar-top-padding) var(--ag-tab-bar-horizontal-padding) 0;
    gap: var(--ag-tab-spacing);
    border-bottom: var(--ag-tab-bar-border);
    flex: 1;
}

.ag-tabs-header-wrapper {
    display: flex;
}

.ag-tabs-close-button-wrapper {
    border: 0;
    border-right: solid var(--ag-border-width) var(--ag-border-color);
    padding: var(--ag-spacing);
    display: flex;
    align-items: center;
}

.ag-tabs-close-button {
    border: 0;
    background-color: unset;
    cursor: pointer;
    padding: 0;
}

.ag-tab {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--ag-tab-top-padding) var(--ag-tab-horizontal-padding) var(--ag-tab-bottom-padding);
    border-left: solid var(--ag-tab-selected-border-width) transparent;
    border-right: solid var(--ag-tab-selected-border-width) transparent;
    flex: 1;
    background-color: var(--ag-tab-background-color);
    color: var(--ag-tab-text-color);

    &:hover {
        background-color: var(--ag-tab-hover-background-color);
        color: var(--ag-tab-hover-text-color);
    }

    &.ag-tab-selected {
        background-color: var(--ag-tab-selected-background-color);
        color: var(--ag-tab-selected-text-color);

        &:where(:not(:first-of-type)) {
            border-left-color: var(--ag-tab-selected-border-color);
        }

        &:where(:not(:last-of-type)) {
            border-right-color: var(--ag-tab-selected-border-color);
        }
    }

    &::after {
        content: '';
        display: block;
        position: absolute;
        height: var(--ag-tab-selected-underline-width);
        background-color: var(--ag-tab-selected-underline-color);
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        transition: opacity var(--ag-tab-selected-underline-transition-duration);
    }

    &.ag-tab-selected::after {
        opacity: 1;
    }
}
